//
//  ViewController.m
//  JKRuntimeTest
//
//  Created by 王冲 on 2018/10/7.
//  Copyright © 2018年 JK科技有限公司. All rights reserved.
//

#import "ViewController.h"
#import "Person.h"
#import "Student.h"
#import "People.h"
#import <objc/runtime.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor brownColor];

    /**
        1.测试对象方法的动态解析
     */
    //[person test];
    
    /**
        2.测试类方法的动态解析
     */
    //[Person classTest];
    
    /**
        3.测试消息转发
     */
    //[[Student new] test];
    
    /**
        4.测试消息转发
     */
    //[Student classTest];
    
    /**
        5.测试面试题的打印
     */
    //Student *student = [[Student alloc]init];
    //[student printContent];
    
    /**
        解释： isMemberOfClass 与 isKindOfClass 的区别
     */
    /**
    id student = [[Student alloc]init];
    
    NSLog(@"%d",[student isMemberOfClass:[Student class]]);
    NSLog(@"%d",[student isMemberOfClass:[NSObject class]]);
    
    NSLog(@"%d",[student isKindOfClass:[Student class]]);
    NSLog(@"%d",[student isKindOfClass:[NSObject class]]);
    */
    
    
    //NSLog(@"%d",[Student isKindOfClass:[NSObject class]]);
    
    NSLog(@"%d",[Student isMemberOfClass:object_getClass([Student class])]);
    NSLog(@"%d",[Student isMemberOfClass:object_getClass([NSObject class])]);
    
    NSLog(@"%d",[Student isKindOfClass:object_getClass([Student class])]);
    NSLog(@"%d",[Student isKindOfClass:object_getClass([NSObject class])]);
   
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
